import Store from '../store/index';
function FileIdToUrl (source) {
  if (source instanceof Array) {
    let list = []
    source.map(it => {
      list.push(FileIdToUrl(it))
    })
    return list
  } else if (typeof (source) == "string" || typeof (source) == "number") {
    if (String(source).startsWith("http")) {
      return source
    }
    return Store.state.baseURL + 'api/File?id=' + source
  }
  return source
}

export default {
  FileIdToUrl,
};